(0) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^1).
The TRS R consists of the following rules:
flatten(nil) → nil
flatten(unit(x)) → flatten(x)
flatten(++(x, y)) → ++(flatten(x), flatten(y))
flatten(++(unit(x), y)) → ++(flatten(x), flatten(y))
flatten(flatten(x)) → flatten(x)
rev(nil) → nil
rev(unit(x)) → unit(x)
rev(++(x, y)) → ++(rev(y), rev(x))
rev(rev(x)) → x
++(x, nil) → x
++(nil, y) → y
++(++(x, y), z) → ++(x, ++(y, z))
Rewrite Strategy: INNERMOST
(1) DependencyGraphProof (BOTH BOUNDS(ID, ID) transformation)
The following rules are not reachable from basic terms in the dependency graph and can be removed:
rev(++(x, y)) → ++(rev(y), rev(x))
rev(rev(x)) → x
(2) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^1).
The TRS R consists of the following rules:
flatten(nil) → nil
rev(unit(x)) → unit(x)
flatten(++(unit(x), y)) → ++(flatten(x), flatten(y))
flatten(++(x, y)) → ++(flatten(x), flatten(y))
++(++(x, y), z) → ++(x, ++(y, z))
rev(nil) → nil
flatten(flatten(x)) → flatten(x)
flatten(unit(x)) → flatten(x)
++(x, nil) → x
++(nil, y) → y
Rewrite Strategy: INNERMOST
(3) NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID) transformation)
The TRS does not nest defined symbols.
Hence, the left-hand sides of the following rules are not basic-reachable and can be removed:
flatten(++(unit(x), y)) → ++(flatten(x), flatten(y))
flatten(++(x, y)) → ++(flatten(x), flatten(y))
++(++(x, y), z) → ++(x, ++(y, z))
flatten(flatten(x)) → flatten(x)
(4) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^1).
The TRS R consists of the following rules:
flatten(nil) → nil
rev(unit(x)) → unit(x)
rev(nil) → nil
flatten(unit(x)) → flatten(x)
++(x, nil) → x
++(nil, y) → y
Rewrite Strategy: INNERMOST
(5) CpxTrsMatchBoundsTAProof (EQUIVALENT transformation)
A linear upper bound on the runtime complexity of the TRS R could be shown with a Match-Bound[TAB_LEFTLINEAR,TAB_NONLEFTLINEAR] (for contructor-based start-terms) of 1.
The compatible tree automaton used to show the Match-Boundedness (for constructor-based start-terms) is represented by:
final states : [1, 2, 3]
transitions:
nil0() → 0
unit0(0) → 0
flatten0(0) → 1
rev0(0) → 2
++0(0, 0) → 3
nil1() → 1
unit1(0) → 2
nil1() → 2
flatten1(0) → 1
0 → 3
(6) BOUNDS(1, n^1)
(7) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted Cpx (relative) TRS to CDT
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
flatten(nil) → nil
flatten(unit(z0)) → flatten(z0)
rev(unit(z0)) → unit(z0)
rev(nil) → nil
++(z0, nil) → z0
++(nil, z0) → z0
Tuples:
FLATTEN(nil) → c
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
REV(unit(z0)) → c2
REV(nil) → c3
++'(z0, nil) → c4
++'(nil, z0) → c5
S tuples:
FLATTEN(nil) → c
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
REV(unit(z0)) → c2
REV(nil) → c3
++'(z0, nil) → c4
++'(nil, z0) → c5
K tuples:none
Defined Rule Symbols:
flatten, rev, ++
Defined Pair Symbols:
FLATTEN, REV, ++'
Compound Symbols:
c, c1, c2, c3, c4, c5
(9) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)
Removed 5 trailing nodes:
++'(nil, z0) → c5
++'(z0, nil) → c4
FLATTEN(nil) → c
REV(unit(z0)) → c2
REV(nil) → c3
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:
flatten(nil) → nil
flatten(unit(z0)) → flatten(z0)
rev(unit(z0)) → unit(z0)
rev(nil) → nil
++(z0, nil) → z0
++(nil, z0) → z0
Tuples:
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
S tuples:
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
K tuples:none
Defined Rule Symbols:
flatten, rev, ++
Defined Pair Symbols:
FLATTEN
Compound Symbols:
c1
(11) CdtUsableRulesProof (EQUIVALENT transformation)
The following rules are not usable and were removed:
flatten(nil) → nil
flatten(unit(z0)) → flatten(z0)
rev(unit(z0)) → unit(z0)
rev(nil) → nil
++(z0, nil) → z0
++(nil, z0) → z0
(12) Obligation:
Complexity Dependency Tuples Problem
Rules:none
Tuples:
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
S tuples:
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
K tuples:none
Defined Rule Symbols:none
Defined Pair Symbols:
FLATTEN
Compound Symbols:
c1
(13) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
We considered the (Usable) Rules:none
And the Tuples:
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(FLATTEN(x1)) = x1
POL(c1(x1)) = x1
POL(unit(x1)) = [1] + x1
(14) Obligation:
Complexity Dependency Tuples Problem
Rules:none
Tuples:
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
S tuples:none
K tuples:
FLATTEN(unit(z0)) → c1(FLATTEN(z0))
Defined Rule Symbols:none
Defined Pair Symbols:
FLATTEN
Compound Symbols:
c1
(15) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)
The set S is empty
(16) BOUNDS(1, 1)